import subprocess


def install_requirements():
    try:
        # 安装requirements.txt中的依赖
        subprocess.check_call(['pip', 'install', '-r', 'requirements.txt'])
        print("依赖安装成功。")
    except subprocess.CalledProcessError as e:
        print("依赖安装失败。", e)


if __name__ == "__main__":
    install_requirements()
